#include "framework/accept_event_handler.h"

using namespace std;
using namespace basic::library2;
using namespace basic::framework;

#if 0
template<class TServiceHandler>
CAcceptEventHandler<TServiceHandler>::CAcceptEventHandler(apr_int16_t wPort)
{
	m_poListener = new CSockAcceptor(wPort);
	m_stHandle.dwHandleType = F_SOCKET;
	m_stHandle.h.socket = poListener->GetSocket();

}


template<class TServiceHandler>
CAcceptEventHandler<TServiceHandler>::~CAcceptEventHandler()
{
	delete m_poListener;
}

template<class TServiceHandler>
F_HANDLE *CAcceptEventHandler<TServiceHandler>::GetHandle()  const
{
	return &m_stHandle;
}

template<class TServiceHandler>
apr_status_t CAcceptEventHandler<TServiceHandler>::HandleInput(F_HANDLE *hHandle)
{
	CSocket *poSocket = m_poListener->Accept();
	TServiceHandler *poNewServiceHandler = new TServiceHandler();
	TServiceHandler->SetSocket(poSocket);

	return APR_SUCCESS;
}
#endif